package com.fh.area.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fh.area.entity.po.AreaPo;
import com.fh.area.entity.vo.Area;
import com.fh.area.entity.vo.AreaVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 描述:
 * Author:袁亚强
 * Date:2021/12/149:08
 */
@Mapper
public interface AreaMapper extends BaseMapper<AreaVo> {

    @Select("select * from t_area ")
    List<Area> queryArea();

    @Select("select name from t_area where id=#{id}")
    String queryName(Integer id);

    @Select("SELECT a.pid,a.sid,a.xid,a.isdefalut,a.id,a.vid,a.name,a.address,a.emailCode,a.iphone,b.`name` as sheng,c.`name` as shi,d.`name` as xian FROM t_api_area a LEFT JOIN t_area b on a.pid=b.id LEFT JOIN t_area c on a.sid=c.id LEFT JOIN t_area d on a.xid=d.id where a.vid=#{id}")
    List<AreaPo> queryList(Integer id);
}
